<?php
/**
 * bs多规格sku商城系统
 * ============================================================================
 * 版权所有 2024-2099 wltx666.com，并保留所有权利。
 * 网站地址: https://wltx666.com
 * ============================================================================
 * Author: 草上飞
 * Email: wltx@alipay168.cn
 * QQ: 2719875001
 * Date: 2024/12/15
 * 描述:
 */

use think\facade\Route;

Route::post('login', 'app\admin\controller\Login@login');//登录
Route::post('logout', 'app\admin\controller\Login@logout');//退出登录
Route::get('info', 'app\admin\controller\Setting@admin_info');//账户信息
Route::put('change_pwd', 'app\admin\controller\Setting@change_password');//账户信息


// 用户管理相关
Route::group('user', function () {
    Route::rule('list', 'app\admin\controller\User@list', 'GET|POST');// 获取用户列表
    Route::rule('get', 'app\admin\controller\User@get', 'POST|GET'); // 获取指定用户信息
    Route::put('save', 'app\admin\controller\User@save');// 新增、修改
    Route::get('options', 'app\admin\controller\User@options');// 获取用户
    Route::put('recharge', 'app\admin\controller\User@recharge');// 充值
});

// 包更新管理相关
Route::group('package', function () {
    Route::get('list', 'app\admin\controller\Package@list');// 获取列表
    Route::get('get', 'app\admin\controller\Package@get'); // 获取指定信息
    Route::put('status', 'app\admin\controller\Package@status'); //
    Route::post('add', 'app\admin\controller\Package@add');// 新增
    Route::post('save', 'app\admin\controller\Package@add');// 新增
    Route::put('save', 'app\admin\controller\Package@update');// 修改
    Route::delete('delete', 'app\admin\controller\Package@delete');// 删除
    Route::post('push_update', 'app\admin\controller\Package@start_update');// 推送更新
});

// 配置项
Route::group('setting', function () {
    Route::rule('list', 'app\admin\controller\Setting@list', 'GET');
    Route::get('get', 'app\admin\controller\Setting@get');// 获取配置项
    Route::get('key', 'app\admin\controller\Setting@key_info');// 获取配置项
    Route::rule('save', 'app\admin\controller\Setting@save_data', 'POST|PUT');// 更新配置项
    Route::delete('delete', 'app\admin\controller\Setting@delete');
});

//上传相关
Route::group('upload', function () {
    Route::rule('file', 'app\admin\controller\Upload@file', 'POST');//图片上传
    Route::rule('image', 'app\admin\controller\Upload@image', 'POST');//图片上传
    Route::rule('chunk', 'app\admin\controller\Upload@chunk', 'POST');//文件分片上传
    Route::rule('upload_group', 'app\admin\controller\Upload@list_group', 'POST|GET|PUT|DELETE');
    Route::rule('index', 'app\admin\controller\Upload@list', 'POST|GET');
    Route::rule('list', 'app\admin\controller\Upload@list', 'POST|GET');
    Route::get('get', 'app\admin\controller\Upload@get');
    Route::delete('delete', 'app\admin\controller\Upload@del_data');
    Route::rule('ueditor', 'app\admin\controller\Upload@ueditor', 'POST|GET|DELETE|PUT');

});

//统计
Route::group('statistics', function () {
    Route::get('list', 'app\admin\controller\Statistics@list');
});

//更新日志
Route::group('update_log', function () {
    Route::get('list', 'app\admin\controller\UpdateLog@list');
    Route::get('get', 'app\admin\controller\UpdateLog@get');
    Route::rule('save', 'app\admin\controller\UpdateLog@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\UpdateLog@del_data');
});

//反馈
Route::group('feedback', function () {
    Route::get('list', 'app\admin\controller\Feedback@list');
    Route::get('get', 'app\admin\controller\Feedback@get');
    Route::rule('save', 'app\admin\controller\Feedback@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Feedback@del_data');
});

//通知管理
Route::group('notice', function () {
    Route::get('list', 'app\admin\controller\Notice@list');
    Route::get('get', 'app\admin\controller\Notice@get');
    Route::rule('save', 'app\admin\controller\Notice@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Notice@del_data');
});

//帮助
Route::group('help', function () {
    Route::get('list', 'app\admin\controller\Help@list');
    Route::get('get', 'app\admin\controller\Help@get');
    Route::rule('save', 'app\admin\controller\Help@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Help@del_data');
});

// 队列
Route::group('queue', function () {
    Route::rule('list', 'app\admin\controller\Queue@list', 'GET');
    Route::get('get', 'app\admin\controller\Queue@get');//
    Route::rule('save', 'app\admin\controller\Queue@save_data', 'POST|PUT');//
    Route::delete('delete', 'app\admin\controller\Queue@del_data');
    Route::post('re_do', 'app\admin\controller\Queue@redo_job');
});

//访客日志
Route::group('access_log', function () {
    Route::rule('list', 'app\admin\controller\AccessLog@list', 'GET');
    Route::get('get', 'app\admin\controller\AccessLog@get');//
    Route::rule('save', 'app\admin\controller\AccessLog@save_data', 'POST|PUT');//
    Route::delete('delete', 'app\admin\controller\AccessLog@del_data');
});

//短信日志
Route::group('code_log', function () {
    Route::rule('list', 'app\admin\controller\CodeLog@list', 'GET');
});

//系统统计
Route::group('sys_statistics', function () {
    Route::rule('list', 'app\admin\controller\SysStatistics@list', 'GET');
});

//扩展插件
Route::group('plugins', function () {
    Route::get('list', 'app\admin\controller\Plugins@list');
    Route::get('get', 'app\admin\controller\Plugins@get');
    Route::rule('save', 'app\admin\controller\Plugins@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Plugins@del_data');
});

//商品管理
Route::group('goods', function () {
    Route::get('list', 'app\admin\controller\Goods@list');
    Route::get('get', 'app\admin\controller\Goods@get');
    Route::rule('save', 'app\admin\controller\Goods@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Goods@del_data');
    Route::put('status', 'app\admin\controller\Goods@status');
    Route::put('restore', 'app\admin\controller\Goods@restore');
});

//商品分类管理
Route::group('goods_category', function () {
    Route::get('list', 'app\admin\controller\GoodsCategory@list');
    Route::get('get', 'app\admin\controller\GoodsCategory@get');
    Route::rule('save', 'app\admin\controller\GoodsCategory@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\GoodsCategory@del_data');
    Route::put('status', 'app\admin\controller\GoodsCategory@status');
    Route::get('list_options', 'app\admin\controller\GoodsCategory@list_options');
    Route::post('copy', 'app\admin\controller\GoodsCategory@copy');
});

//轮播图管理
Route::group('banner', function () {
    Route::get('list', 'app\admin\controller\Banner@list');
    Route::get('get', 'app\admin\controller\Banner@get');
    Route::rule('save', 'app\admin\controller\Banner@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Banner@del_data');
    Route::put('status', 'app\admin\controller\Banner@status');
});


//订单管理
Route::group('order', function () {
    Route::get('list', 'app\admin\controller\Order@list');
    Route::get('get', 'app\admin\controller\Order@get');
    Route::delete('delete', 'app\admin\controller\Order@del_data');
    Route::put('check', 'app\admin\controller\Order@pay_check');
    Route::put('edit_price', 'app\admin\controller\Order@edit_price');
    Route::post('send', 'app\admin\controller\Order@send');
    Route::post('refund_save', 'app\admin\controller\Order@refund_save');
});

//导航管理
Route::group('navs', function () {
    Route::get('list', 'app\admin\controller\Navs@list');
    Route::get('get', 'app\admin\controller\Navs@get');
    Route::rule('save', 'app\admin\controller\Navs@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Navs@del_data');
    Route::put('status', 'app\admin\controller\Navs@status');
});

//优惠券管理
Route::group('coupon', function () {
    Route::get('coupon_log', 'app\admin\controller\Coupon@coupon_log');
    Route::get('list', 'app\admin\controller\Coupon@list');
    Route::get('get', 'app\admin\controller\Coupon@get');
    Route::rule('save', 'app\admin\controller\Coupon@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Coupon@del_data');
    Route::put('status', 'app\admin\controller\Coupon@status');
});

//curd
Route::group('curd', function () {
    Route::get('table_info', 'app\admin\controller\Curd@table_info');
    Route::post('save', 'app\admin\controller\Curd@save_data');
});

//聊天客服
Route::group('chat', function () {
    Route::get('history_list', 'app\admin\controller\Chat@history_list');
    Route::get('ready', 'app\admin\controller\Chat@ready');
    Route::get('conversations', 'app\admin\controller\Chat@conversations');
});

//客服管理
Route::group('kefu', function () {
    Route::get('list', 'app\admin\controller\KeFu@list');
    Route::get('get', 'app\admin\controller\KeFu@get');
    Route::rule('save', 'app\admin\controller\KeFu@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\KeFu@del_data');
    Route::put('status', 'app\admin\controller\KeFu@status');
});

//品牌管理
Route::group('goods_brand', function () {
    Route::get('list', "app\admin\controller\auto\GoodsBrand@list");
    Route::get('get', "app\admin\controller\auto\GoodsBrand@get");
    Route::rule('save', "app\admin\controller\auto\GoodsBrand@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\auto\GoodsBrand@del_data");
    Route::get('list_options', 'app\admin\controller\auto\GoodsBrand@list_options');
    Route::put('status', "app\admin\controller\auto\GoodsBrand@status");
});

//余额记录
Route::group('credit_log', function () {
    Route::get('list', "app\admin\controller\auto\CreditLog@list");
    Route::get('get', "app\admin\controller\auto\CreditLog@get");
});

//积分记录
Route::group('point_log', function () {
    Route::get('list', "app\admin\controller\auto\PointLog@list");
    Route::get('get', "app\admin\controller\auto\PointLog@get");
});

//充值记录
Route::group('recharge_log', function () {
    Route::get('list', "app\admin\controller\auto\RechargeLog@list");
    Route::get('get', "app\admin\controller\auto\RechargeLog@get");
    Route::put('check', "app\admin\controller\auto\RechargeLog@check");
});

//充值套餐
Route::group('recharge_package', function () {
    Route::get('list', "app\admin\controller\auto\RechargePackage@list");
    Route::get('get', "app\admin\controller\auto\RechargePackage@get");
    Route::rule('save', "app\admin\controller\auto\RechargePackage@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\auto\RechargePackage@del_data");
    Route::get('list_options', 'app\admin\controller\auto\RechargePackage@list_options');
    Route::put('status', "app\admin\controller\auto\RechargePackage@status");
});

//菜单管理
Route::group('menus', function () {
    Route::get('my_list', "app\admin\controller\Menus@my_list");//我的菜单
    Route::get('list', "app\admin\controller\Menus@list");
    Route::get('get', "app\admin\controller\Menus@get");
    Route::rule('save', "app\admin\controller\Menus@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\Menus@del_data");
    Route::post('copy', "app\admin\controller\Menus@copy");
    Route::get('list_options', 'app\admin\controller\Menus@list_options');
});

//管理员管理
Route::group('admin', function () {
    Route::get('list', "app\admin\controller\Admin@list");
    Route::get('get', "app\admin\controller\Admin@get");
    Route::rule('save', "app\admin\controller\Admin@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\Admin@del_data");
    Route::put('status', 'app\admin\controller\Admin@status');
});

//角色管理
Route::group('role', function () {
    Route::get('list', "app\admin\controller\auto\Role@list");
    Route::get('get', "app\admin\controller\auto\Role@get");
    Route::rule('save', "app\admin\controller\auto\Role@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\auto\Role@del_data");
    Route::get('list_options', 'app\admin\controller\auto\Role@list_options');
    Route::put('status', "app\admin\controller\auto\Role@status");
    Route::get('auths', "app\admin\controller\auto\Role@auths");
    Route::put('auths_save', "app\admin\controller\auto\Role@auths_save");
});

//消息管理
Route::group('admin_msg', function () {
    Route::get('list', "app\admin\controller\auto\AdminMsg@list");
    Route::delete('delete', "app\admin\controller\auto\AdminMsg@del_data");
});

//目录检查
Route::group('local-directory', function () {
    Route::get('list', 'app\admin\controller\LocalFileManager@list');
    Route::post('clear', 'app\admin\controller\LocalFileManager@clear');
});

//商品库存日志
Route::group('goods_stock_log', function () {
    Route::get('list', "app\admin\controller\auto\GoodsStockLog@list");
    Route::rule('save', "app\admin\controller\auto\GoodsStockLog@save_data", 'POST|PUT');
    Route::rule('query_goods', "app\admin\controller\auto\GoodsStockLog@query_goods", 'GET');
});

//应用管理
Route::group('application', function () {
    Route::get('list', "app\admin\controller\auto\Application@list");
    Route::get('get', "app\admin\controller\auto\Application@get");
    Route::rule('save', "app\admin\controller\auto\Application@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\auto\Application@del_data");
    Route::post('install', "app\admin\controller\auto\Application@install");
    Route::post('uninstall', "app\admin\controller\auto\Application@uninstall");
    Route::post('enable', "app\admin\controller\auto\Application@enable");
    Route::post('disable', "app\admin\controller\auto\Application@disable");
    Route::post('upgrade', "app\admin\controller\auto\Application@upgrade");
    Route::put('status', "app\admin\controller\auto\Application@status");
});
